import * as API from "@/api/axios";
import * as util from "@/common/util";

export default {

    createModify: (params) => {
        const url = '/manage/faqs'
        const headers = {'lang-key': params.id ? 'branch_Edit' : 'branch_Create'}
        if (params.id) {
            return API.axiosPutAPI(url, params, headers)
        } else {
            return API.axiosPostAPI(url, params, headers)
        }
    },

    getPage: (params, page) => {
        const url = util.replacePageNumAndSize(`/manage/faqs/{pageNum}/{pageSize}`, page)
        return API.axiosGetAPI(url, params)
    },

    getDetail: id => {
        return API.axiosGetAPI(`/manage/faqs/${id}`)
    },


    // 修改状态
    modifyState: (params) => {
        const headers = {'lang-key': params.state == 1 ? 'Station_Open' : 'Station_Close'}
        return API.axiosPutAPI('/manage/faqs/state', params, headers)
    },
}
